package com.jack.mvvmexample.api.repositorys

import com.aleyn.mvvm.base.BaseModel
import com.jack.mvvmexample.api.BaseResult
import com.jack.mvvmexample.api.network.HomeNetwork
import com.jack.mvvmexample.bean.UserBean

class HomeRepository private constructor(val network : HomeNetwork) : BaseModel(){

    suspend fun getVideoList() : BaseResult<List<UserBean>>{
        return network.getVideoList()
    }


    companion object {

        @Volatile
        private var INSTANCE: HomeRepository? = null

        fun getInstance(netWork: HomeNetwork) =
            INSTANCE ?: synchronized(this) {
                INSTANCE ?: HomeRepository(netWork).also { INSTANCE = it }
            }
    }
}